{
 "cells": [
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {
    "id": "WEAOgfGWlvrV"
   },
   "source": [
    "# Control"
   ]
  },
  {
   "cell_type": "markdown",
   "source": [
    "Convex optimization can be used to solve many problems that arise in control.\n",
    "In this example we show how to solve such a problem using CVXPY.\n",
    "We have a system with a state $x_t\\in {\\bf R}^n$ that varies over the time steps $t=0,\\ldots,T$, and inputs or actions $u_t\\in {\\bf R}^m$ we can use at each time step to affect the state.\n",
    "For example, $x_t$ might be the position and velocity of a rocket and $u_t$ the output of the rocket's thrusters.\n",
    "We model the evolution of the state as a linear dynamical system, i.e.,\n",
    "\n",
    "$$ x_{t+1} = Ax_t + Bu_t $$\n",
    "\n",
    "where $A \\in {\\bf R}^{n\\times n}$ and $B \\in {\\bf R}^{n\\times m}$ are known matrices.\n",
    "\n",
    "Our goal is to find the optimal actions $u_0,\\ldots,u_{T-1}$ by solving the optimization problems\n",
    "\n",
    "\\begin{array}{ll} \\mbox{minimize} & \\sum_{t=0}^{T-1} \\ell (x_t,u_t) + \\ell_T(x_T)\\\\\n",
    "\\mbox{subject to} & x_{t+1} = Ax_t + Bu_t\\\\%, \\quad t=0, \\ldots, T-1\\\\\n",
    "& (x_t,u_t) \\in \\mathcal C, \\quad x_T\\in \\mathcal C_T,\n",
    "%, \\quad \\quad t=0, \\ldots, T\n",
    "\\end{array}\n",
    "\n",
    "where $\\ell: {\\bf R}^n \\times {\\bf R}^m\\to {\\bf R}$ is the stage cost, $\\ell_T$ is the terminal cost,\n",
    "$\\mathcal C$ is the state/action constraints, and $\\mathcal C_T$ is the terminal constraint.\n",
    "The optimization problem is convex if the costs and constraints are convex.\n"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {
    "id": "kOKie3ODlvrc"
   },
   "source": [
    "### Example\n",
    "\n",
    "In the following code we solve a control problem with $n=8$ states, $m=2$ inputs, and horizon $T=50$.\n",
    "The matrices $A$ and $B$ and the initial state $x_0$ are randomly chosen (with $A\\approx I$).\n",
    "We use the (traditional) stage cost $\\ell(x,u) = \\|x\\|_2^2 + \\|u\\|_2^2$, the input constraint $\\|u_t\\|_\\infty \\leq 1$, and the terminal constraint $x_{T}=0$."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {
    "id": "tCpPBRG_lvrd",
    "ExecuteTime": {
     "end_time": "2023-05-21T10:14:26.228402900Z",
     "start_time": "2023-05-21T10:14:26.207052300Z"
    }
   },
   "outputs": [],
   "source": [
    "# Generate data for control problem.\n",
    "import numpy as np\n",
    "np.random.seed(1)\n",
    "n = 8 # 状态维度\n",
    "m = 2 # 输入维度\n",
    "T = 50 # 时域长度\n",
    "alpha = 0.2 # 紧凑型随机矩阵的系数\n",
    "beta = 5 # 初始状态的系数\n",
    "A = np.eye(n) + alpha*np.random.randn(n,n) # 使用 NumPy 生成一个大小为 (n,n) 的单位矩阵，并在其上加上一个紧凑型随机矩阵, 状态转移矩阵\n",
    "B = np.random.randn(n,m) # 使用 NumPy 生成一个大小为 (n,m) 的随机矩阵, 输入矩阵\n",
    "x_0 = beta*np.random.randn(n) # 使用 NumPy 生成一个大小为 (n,) 的随机向量， 初始状态"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {
    "id": "L44FuNzblvre",
    "outputId": "ad643ce5-73cc-45d8-8d83-d6d0ec0f09a0",
    "ExecuteTime": {
     "end_time": "2023-05-21T10:14:27.162456400Z",
     "start_time": "2023-05-21T10:14:26.228679200Z"
    }
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "E:\\python\\lib\\site-packages\\cvxpy\\problems\\problem.py:1385: UserWarning: Solution may be inaccurate. Try another solver, adjusting the solver settings, or solve with verbose=True for more information.\n",
      "  warnings.warn(\n"
     ]
    },
    {
     "data": {
      "text/plain": "64470.63768245135"
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Form and solve control problem.\n",
    "import cvxpy as cp\n",
    "\n",
    "x = cp.Variable((n, T+1)) # 使用 CVXPY 生成一个大小为 (n,T+1) 的变量矩阵，状态矩阵\n",
    "u = cp.Variable((m, T)) # 使用 CVXPY 生成一个大小为 (m,T) 的变量矩阵，输入矩阵\n",
    "\n",
    "cost = 0 # 经验损失\n",
    "constr = [] # 约束条件\n",
    "for t in range(T):\n",
    "    cost += cp.sum_squares(x[:,t+1]) + cp.sum_squares(u[:,t]) # sums stage costs.\n",
    "    constr += [x[:,t+1] == A@x[:,t] + B@u[:,t], # dynamic constraints.\n",
    "               cp.norm(u[:,t], 'inf') <= 1] # input constraints.\n",
    "# sums problem objectives and concatenates constraints.\n",
    "constr += [x[:,T] == 0, x[:,0] == x_0]\n",
    "problem = cp.Problem(cp.Minimize(cost), constr)\n",
    "problem.solve(solver=cp.ECOS)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "optimal cost: 13.33466666660105\n",
      "optimal position:\n",
      " [[ 1.00000000e-01  9.33333345e-02  8.66666685e-02  8.00000021e-02\n",
      "   7.33333354e-02  6.66666683e-02  6.00000012e-02  5.33333338e-02\n",
      "   4.66666665e-02  3.99999991e-02  3.33333319e-02  2.66666649e-02\n",
      "   1.99999981e-02  1.33333317e-02  6.66666561e-03  4.31701885e-14]\n",
      " [ 5.00000000e+00  4.33333345e+00  3.66666684e+00  3.00000020e+00\n",
      "   2.33333353e+00  1.66666683e+00  1.00000010e+00  3.33333369e-01\n",
      "  -3.33333369e-01 -1.00000010e+00 -1.66666683e+00 -2.33333353e+00\n",
      "  -3.00000020e+00 -3.66666684e+00 -4.33333345e+00 -5.00000000e+00]]\n"
     ]
    }
   ],
   "source": [
    "# no obstacle\n",
    "import numpy as np\n",
    "import cvxpy as cp\n",
    "\n",
    "# Generate data for control problem.\n",
    "np.random.seed(1)\n",
    "n = 2  # 状态维度\n",
    "m = 2  # 输入维度\n",
    "T = 15  # 时域长度\n",
    "A = np.eye(n)  # 使用 NumPy 生成一个大小为 (n,n) 的单位矩阵 状态转移矩阵\n",
    "B = np.eye(n)  # 使用 NumPy 生成一个大小为 (n,n) 的单位矩阵 输入矩阵\n",
    "x_0 = [0.1, 5]  # 初始状态\n",
    "x_t = [0, -5]  # 终止状态\n",
    "\n",
    "# Form and solve control problem.\n",
    "x = cp.Variable((n, T+1)) # 使用 CVXPY 生成一个大小为 (n,T+1) 的变量矩阵，状态矩阵\n",
    "u = cp.Variable((m, T)) # 使用 CVXPY 生成一个大小为 (m,T) 的变量矩阵，输入矩阵\n",
    "\n",
    "cost = 0 # 经验损失\n",
    "constr = [] # 约束条件\n",
    "for t in range(T):\n",
    "    cost += cp.sum_squares(x[:,t+1] - x[:,t]) + cp.sum_squares(u[:,t]) # sums stage costs.\n",
    "    constr += [x[:,t+1] == A@x[:,t] + B@u[:,t], # dynamic constraints.\n",
    "               cp.norm(u[:,t], 'inf') <= 1] # input constraints.\n",
    "# sums problem objectives and concatenates constraints.\n",
    "constr += [x[:,T] == x_t, x[:,0] == x_0] # terminal constraint, initial condition.\n",
    "problem = cp.Problem(cp.Minimize(cost), constr) # 生成优化问题\n",
    "problem.solve(solver=cp.ECOS) # 求解优化问题\n",
    "print(\"optimal cost:\", problem.value) # 输出优化问题的最优值\n",
    "print(\"optimal position:\\n\", x.value) # 输出优化问题的最优解"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-05-22T10:51:08.419106Z",
     "start_time": "2023-05-22T10:51:08.316597600Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "optimal cost: 15.561826347020638\n",
      "optimal position:\n",
      " [[ 1.00000000e-01  3.73465431e-01  6.46930824e-01  9.20396216e-01\n",
      "   1.19386162e+00  1.46732704e+00  1.74079244e+00  2.01425784e+00\n",
      "   2.00931957e+00  1.72228263e+00  1.43524588e+00  1.14820476e+00\n",
      "   8.61159928e-01  5.74111467e-01  2.87058862e-01 -5.96254536e-12]\n",
      " [ 5.00000000e+00  4.34067935e+00  3.68135870e+00  3.02203806e+00\n",
      "   2.36271741e+00  1.70339678e+00  1.04407614e+00  3.84755490e-01\n",
      "  -3.96070479e-01 -1.05377852e+00 -1.71148663e+00 -2.36919282e+00\n",
      "  -3.02689738e+00 -3.68460037e+00 -4.34230155e+00 -5.00000000e+00]]\n"
     ]
    }
   ],
   "source": [
    "# a circular obstacle at point (0, 0) and its radius is 2\n",
    "import numpy as np\n",
    "import cvxpy as cp\n",
    "\n",
    "# Generate data for control problem.\n",
    "np.random.seed(1)\n",
    "n = 2  # 状态维度\n",
    "m = 2  # 输入维度\n",
    "T = 15  # 时域长度\n",
    "A = np.eye(n)  # 使用 NumPy 生成一个大小为 (n,n) 的单位矩阵 状态转移矩阵\n",
    "B = np.eye(n)  # 使用 NumPy 生成一个大小为 (n,n) 的单位矩阵 输入矩阵\n",
    "x_0 = [0.1, 5]  # 初始状态\n",
    "x_t = [0, -5]  # 终止状态\n",
    "\n",
    "# Form and solve control problem.\n",
    "x = cp.Variable((n, T+1)) # 使用 CVXPY 生成一个大小为 (n,T+1) 的变量矩阵，状态矩阵\n",
    "u = cp.Variable((m, T)) # 使用 CVXPY 生成一个大小为 (m,T) 的变量矩阵，输入矩阵\n",
    "\n",
    "cost = 0 # 经验损失\n",
    "constr = [] # 约束条件\n",
    "for t in range(T):\n",
    "    # 构造闸函数\n",
    "    # 闸函数的定义为：g(x) = 0, 4 - cp.norm(x[:,t], 2) <= 0 ，g(x) = +inf, 4 - cp.norm(x[:,t], 2) > 0\n",
    "    # barrier_func = -cp.log(cp.sum_squares(x[:,t]) - 4) # sums stage costs.\n",
    "    cost += cp.sum_squares(x[:,t+1] - x[:,t]) + cp.sum_squares(u[:,t]) # sums stage costs.\n",
    "    if t < 8:\n",
    "        constr += [x[:,t+1] == A@x[:,t] + B@u[:,t], # dynamic constraints.\n",
    "                   cp.norm(u[:,t], 'inf') <= 1, # input constraints.\n",
    "                   # 半平面约束\n",
    "                   -cp.sqrt(21) / 2 * x[0,t] - x[1,t] + 5 <= 0]\n",
    "    if t >= 8:\n",
    "        constr += [x[:,t+1] == A@x[:,t] + B@u[:,t], # dynamic constraints.\n",
    "                   cp.norm(u[:,t], 'inf') <= 1, # input constraints.\n",
    "                   cp.sqrt(21) / 2 * x[0,t] - x[1,t] - 5 >= 0]\n",
    "    # if t == 8:\n",
    "    #     constr += [x[:,t+1] == A@x[:,t] + B@u[:,t], # dynamic constraints.\n",
    "    #                cp.norm(u[:,t], 'inf') <= 1] # input constraints.\n",
    "\n",
    "# sums problem objectives and concatenates constraints.\n",
    "constr += [x[:,T] == x_t, x[:,0] == x_0] # terminal constraint, initial condition.\n",
    "problem = cp.Problem(cp.Minimize(cost), constr) # 生成优化问题\n",
    "problem.solve(solver=cp.ECOS) # 求解优化问题\n",
    "print(\"optimal cost:\", problem.value) # 输出优化问题的最优值\n",
    "print(\"optimal position:\\n\", x.value) # 输出优化问题的最优解"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-05-22T10:51:21.626976700Z",
     "start_time": "2023-05-22T10:51:21.492642500Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "optimal cost: 13.34666667142475\n",
      "optimal position:\n",
      " [[ 1.00000000e-01  8.33333266e-02  6.66666564e-02  4.99999891e-02\n",
      "   3.33333242e-02  1.66666611e-02 -5.40507891e-10  3.33333331e-02\n",
      "   6.66666669e-02  1.00000001e-01  8.33333389e-02  6.66666758e-02\n",
      "   5.00000108e-02  3.33333435e-02  1.66666734e-02  5.01262015e-13]\n",
      " [ 5.00000000e+00  4.33332724e+00  3.66665448e+00  2.99998172e+00\n",
      "   2.33330896e+00  1.66663620e+00  9.99963434e-01  3.33321145e-01\n",
      "  -3.33321145e-01 -9.99963434e-01 -1.66663620e+00 -2.33330896e+00\n",
      "  -2.99998172e+00 -3.66665448e+00 -4.33332724e+00 -5.00000000e+00]]\n"
     ]
    }
   ],
   "source": [
    "# a circular obstacle at point (1, 1) and its radius is 1 and a circular obstacle at point (-0.9, -1) and its radius is 1\n",
    "import numpy as np\n",
    "import cvxpy as cp\n",
    "\n",
    "# Generate data for control problem.\n",
    "np.random.seed(1)\n",
    "n = 2  # 状态维度\n",
    "m = 2  # 输入维度\n",
    "T = 15  # 时域长度\n",
    "A = np.eye(n)  # 使用 NumPy 生成一个大小为 (n,n) 的单位矩阵 状态转移矩阵\n",
    "B = np.eye(n)  # 使用 NumPy 生成一个大小为 (n,n) 的单位矩阵 输入矩阵\n",
    "x_0 = [0.1, 5]  # 初始状态\n",
    "x_t = [0, -5]  # 终止状态\n",
    "\n",
    "# Form and solve control problem.\n",
    "x = cp.Variable((n, T+1)) # 使用 CVXPY 生成一个大小为 (n,T+1) 的变量矩阵，状态矩阵\n",
    "u = cp.Variable((m, T)) # 使用 CVXPY 生成一个大小为 (m,T) 的变量矩阵，输入矩阵\n",
    "\n",
    "cost = 0 # 经验损失\n",
    "constr = [] # 约束条件\n",
    "for t in range(T):\n",
    "    # 构造闸函数\n",
    "    # 闸函数的定义为：g(x) = 0, 4 - cp.norm(x[:,t], 2) <= 0 ，g(x) = +inf, 4 - cp.norm(x[:,t], 2) > 0\n",
    "    # barrier_func = -cp.log(cp.sum_squares(x[:,t]) - 4) # sums stage costs.\n",
    "    cost += cp.sum_squares(x[:,t+1] - x[:,t]) + cp.sum_squares(u[:,t]) # sums stage costs.\n",
    "    if 6 <= t < 7:\n",
    "        constr += [x[:,t+1] == A@x[:,t] + B@u[:,t], # dynamic constraints.\n",
    "                   cp.norm(u[:,t], 'inf') <= 1, # input constraints.\n",
    "                   x[0,t] <= 0]\n",
    "    else:\n",
    "        if 9 <= t < 10:\n",
    "            constr += [x[:,t+1] == A@x[:,t] + B@u[:,t], # dynamic constraints.\n",
    "                       cp.norm(u[:,t], 'inf') <= 1, # input constraints.\n",
    "                       # 半平面约束\n",
    "                       x[0,t] >= 0.1]\n",
    "        else:\n",
    "            constr += [x[:,t+1] == A@x[:,t] + B@u[:,t], # dynamic constraints.\n",
    "                       cp.norm(u[:,t], 'inf') <= 1] # input constraints.\n",
    "\n",
    "# sums problem objectives and concatenates constraints.\n",
    "constr += [x[:,T] == x_t, x[:,0] == x_0] # terminal constraint, initial condition.\n",
    "problem = cp.Problem(cp.Minimize(cost), constr) # 生成优化问题\n",
    "problem.solve(solver=cp.ECOS) # 求解优化问题\n",
    "print(\"optimal cost:\", problem.value) # 输出优化问题的最优值\n",
    "print(\"optimal position:\\n\", x.value) # 输出优化问题的最优解"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-05-22T11:14:36.137508700Z",
     "start_time": "2023-05-22T11:14:35.925658Z"
    }
   }
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {
    "id": "BceuZEShlvrf"
   },
   "source": [
    "We display the results below as a $4$-high stack of plots showing $u_1$, $u_2$, $x_1$, and $x_2$ vs $t$.\n",
    "Notice that $u_t$ is saturated (i.e., $\\|u_t\\|_\\infty = 1$) over more than half of the horizon, which shows that the input constraint is meaningful."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {
    "id": "Gzdt7uDTlvrg",
    "outputId": "1a510d14-64dc-42e5-c219-fc871cb1b6de",
    "ExecuteTime": {
     "end_time": "2023-05-22T11:14:36.634725600Z",
     "start_time": "2023-05-22T11:14:36.153130600Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "<Figure size 640x480 with 4 Axes>",
      "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"452.075187pt\" height=\"338.922344pt\" viewBox=\"0 0 452.075187 338.922344\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n <metadata>\n  <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n   <cc:Work>\n    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n    <dc:date>2023-05-22T19:14:36.372547</dc:date>\n    <dc:format>image/svg+xml</dc:format>\n    <dc:creator>\n     <cc:Agent>\n      <dc:title>Matplotlib v3.7.1, https://matplotlib.org/</dc:title>\n     </cc:Agent>\n    </dc:creator>\n   </cc:Work>\n  </rdf:RDF>\n </metadata>\n <defs>\n  <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n </defs>\n <g id=\"figure_1\">\n  <g id=\"patch_1\">\n   <path d=\"M 0 338.922344 \nL 452.075187 338.922344 \nL 452.075187 0 \nL 0 0 \nz\n\" style=\"fill: #ffffff\"/>\n  </g>\n  <g id=\"axes_1\">\n   <g id=\"patch_2\">\n    <path d=\"M 48.427188 66.479219 \nL 444.875187 66.479219 \nL 444.875187 10.999219 \nL 48.427188 10.999219 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g id=\"matplotlib.axis_1\"/>\n   <g id=\"matplotlib.axis_2\">\n    <g id=\"ytick_1\">\n     <g id=\"line2d_1\">\n      <defs>\n       <path id=\"m53ee27169b\" d=\"M 0 0 \nL -3.5 0 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </defs>\n      <g>\n       <use xlink:href=\"#m53ee27169b\" x=\"48.427188\" y=\"66.479219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_1\">\n      <!-- −1 -->\n      <g transform=\"translate(26.685 70.278437) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-2212\" d=\"M 678 2272 \nL 4684 2272 \nL 4684 1741 \nL 678 1741 \nL 678 2272 \nz\n\" transform=\"scale(0.015625)\"/>\n        <path id=\"DejaVuSans-31\" d=\"M 794 531 \nL 1825 531 \nL 1825 4091 \nL 703 3866 \nL 703 4441 \nL 1819 4666 \nL 2450 4666 \nL 2450 531 \nL 3481 531 \nL 3481 0 \nL 794 0 \nL 794 531 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-2212\"/>\n       <use xlink:href=\"#DejaVuSans-31\" x=\"83.789062\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_2\">\n     <g id=\"line2d_2\">\n      <g>\n       <use xlink:href=\"#m53ee27169b\" x=\"48.427188\" y=\"38.739219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_2\">\n      <!-- 0 -->\n      <g transform=\"translate(35.064688 42.538437) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-30\" d=\"M 2034 4250 \nQ 1547 4250 1301 3770 \nQ 1056 3291 1056 2328 \nQ 1056 1369 1301 889 \nQ 1547 409 2034 409 \nQ 2525 409 2770 889 \nQ 3016 1369 3016 2328 \nQ 3016 3291 2770 3770 \nQ 2525 4250 2034 4250 \nz\nM 2034 4750 \nQ 2819 4750 3233 4129 \nQ 3647 3509 3647 2328 \nQ 3647 1150 3233 529 \nQ 2819 -91 2034 -91 \nQ 1250 -91 836 529 \nQ 422 1150 422 2328 \nQ 422 3509 836 4129 \nQ 1250 4750 2034 4750 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-30\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_3\">\n     <g id=\"line2d_3\">\n      <g>\n       <use xlink:href=\"#m53ee27169b\" x=\"48.427188\" y=\"10.999219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_3\">\n      <!-- 1 -->\n      <g transform=\"translate(35.064688 14.798437) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_4\">\n     <!-- $(u_t)_1$ -->\n     <g transform=\"translate(19.3575 56.339219) rotate(-90) scale(0.16 -0.16)\">\n      <defs>\n       <path id=\"DejaVuSans-28\" d=\"M 1984 4856 \nQ 1566 4138 1362 3434 \nQ 1159 2731 1159 2009 \nQ 1159 1288 1364 580 \nQ 1569 -128 1984 -844 \nL 1484 -844 \nQ 1016 -109 783 600 \nQ 550 1309 550 2009 \nQ 550 2706 781 3412 \nQ 1013 4119 1484 4856 \nL 1984 4856 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-Oblique-75\" d=\"M 428 1388 \nL 838 3500 \nL 1416 3500 \nL 1006 1409 \nQ 975 1256 961 1147 \nQ 947 1038 947 966 \nQ 947 700 1109 554 \nQ 1272 409 1569 409 \nQ 2031 409 2368 721 \nQ 2706 1034 2809 1563 \nL 3194 3500 \nL 3769 3500 \nL 3091 0 \nL 2516 0 \nL 2631 550 \nQ 2388 244 2052 76 \nQ 1716 -91 1338 -91 \nQ 878 -91 622 161 \nQ 366 413 366 863 \nQ 366 956 381 1097 \nQ 397 1238 428 1388 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-Oblique-74\" d=\"M 2706 3500 \nL 2619 3053 \nL 1472 3053 \nL 1100 1153 \nQ 1081 1047 1072 975 \nQ 1063 903 1063 863 \nQ 1063 663 1183 572 \nQ 1303 481 1569 481 \nL 2150 481 \nL 2053 0 \nL 1503 0 \nQ 991 0 739 200 \nQ 488 400 488 806 \nQ 488 878 497 964 \nQ 506 1050 525 1153 \nL 897 3053 \nL 409 3053 \nL 500 3500 \nL 978 3500 \nL 1172 4494 \nL 1747 4494 \nL 1556 3500 \nL 2706 3500 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-29\" d=\"M 513 4856 \nL 1013 4856 \nQ 1481 4119 1714 3412 \nQ 1947 2706 1947 2009 \nQ 1947 1309 1714 600 \nQ 1481 -109 1013 -844 \nL 513 -844 \nQ 928 -128 1133 580 \nQ 1338 1288 1338 2009 \nQ 1338 2731 1133 3434 \nQ 928 4138 513 4856 \nz\n\" transform=\"scale(0.015625)\"/>\n      </defs>\n      <use xlink:href=\"#DejaVuSans-28\" transform=\"translate(0 0.125)\"/>\n      <use xlink:href=\"#DejaVuSans-Oblique-75\" transform=\"translate(39.013672 0.125)\"/>\n      <use xlink:href=\"#DejaVuSans-Oblique-74\" transform=\"translate(102.392578 -16.28125) scale(0.7)\"/>\n      <use xlink:href=\"#DejaVuSans-29\" transform=\"translate(132.573242 0.125)\"/>\n      <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(172.543945 -16.28125) scale(0.7)\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"line2d_4\">\n    <path d=\"M 66.447551 39.201552 \nL 92.190928 39.201552 \nL 117.934304 39.201552 \nL 143.677681 39.201552 \nL 169.421058 39.201552 \nL 195.164434 39.201552 \nL 220.907811 37.814552 \nL 246.651188 37.814552 \nL 272.394564 37.814552 \nL 298.137941 39.201552 \nL 323.881317 39.201552 \nL 349.624694 39.201552 \nL 375.368071 39.201552 \nL 401.111447 39.201552 \nL 426.854824 39.201552 \n\" clip-path=\"url(#p35bcdc312d)\" style=\"fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_3\">\n    <path d=\"M 48.427188 66.479219 \nL 48.427188 10.999219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_4\">\n    <path d=\"M 444.875187 66.479219 \nL 444.875187 10.999219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_5\">\n    <path d=\"M 48.427188 66.479219 \nL 444.875188 66.479219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_6\">\n    <path d=\"M 48.427188 10.999219 \nL 444.875188 10.999219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n  </g>\n  <g id=\"axes_2\">\n   <g id=\"patch_7\">\n    <path d=\"M 48.427188 142.839219 \nL 444.875187 142.839219 \nL 444.875187 87.359219 \nL 48.427188 87.359219 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g id=\"matplotlib.axis_3\"/>\n   <g id=\"matplotlib.axis_4\">\n    <g id=\"ytick_4\">\n     <g id=\"line2d_5\">\n      <g>\n       <use xlink:href=\"#m53ee27169b\" x=\"48.427188\" y=\"142.839219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_5\">\n      <!-- −1 -->\n      <g transform=\"translate(26.685 146.638437) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-2212\"/>\n       <use xlink:href=\"#DejaVuSans-31\" x=\"83.789062\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_5\">\n     <g id=\"line2d_6\">\n      <g>\n       <use xlink:href=\"#m53ee27169b\" x=\"48.427188\" y=\"115.099219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_6\">\n      <!-- 0 -->\n      <g transform=\"translate(35.064688 118.898437) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-30\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_6\">\n     <g id=\"line2d_7\">\n      <g>\n       <use xlink:href=\"#m53ee27169b\" x=\"48.427188\" y=\"87.359219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_7\">\n      <!-- 1 -->\n      <g transform=\"translate(35.064688 91.158437) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_8\">\n     <!-- $(u_t)_2$ -->\n     <g transform=\"translate(19.3575 132.699219) rotate(-90) scale(0.16 -0.16)\">\n      <defs>\n       <path id=\"DejaVuSans-32\" d=\"M 1228 531 \nL 3431 531 \nL 3431 0 \nL 469 0 \nL 469 531 \nQ 828 903 1448 1529 \nQ 2069 2156 2228 2338 \nQ 2531 2678 2651 2914 \nQ 2772 3150 2772 3378 \nQ 2772 3750 2511 3984 \nQ 2250 4219 1831 4219 \nQ 1534 4219 1204 4116 \nQ 875 4013 500 3803 \nL 500 4441 \nQ 881 4594 1212 4672 \nQ 1544 4750 1819 4750 \nQ 2544 4750 2975 4387 \nQ 3406 4025 3406 3419 \nQ 3406 3131 3298 2873 \nQ 3191 2616 2906 2266 \nQ 2828 2175 2409 1742 \nQ 1991 1309 1228 531 \nz\n\" transform=\"scale(0.015625)\"/>\n      </defs>\n      <use xlink:href=\"#DejaVuSans-28\" transform=\"translate(0 0.125)\"/>\n      <use xlink:href=\"#DejaVuSans-Oblique-75\" transform=\"translate(39.013672 0.125)\"/>\n      <use xlink:href=\"#DejaVuSans-Oblique-74\" transform=\"translate(102.392578 -16.28125) scale(0.7)\"/>\n      <use xlink:href=\"#DejaVuSans-29\" transform=\"translate(132.573242 0.125)\"/>\n      <use xlink:href=\"#DejaVuSans-32\" transform=\"translate(172.543945 -16.28125) scale(0.7)\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"line2d_8\">\n    <path d=\"M 66.447551 133.592721 \nL 92.190928 133.592721 \nL 117.934304 133.592721 \nL 143.677681 133.592721 \nL 169.421058 133.592721 \nL 195.164434 133.592721 \nL 220.907811 133.591876 \nL 246.651188 133.591876 \nL 272.394564 133.591876 \nL 298.137941 133.592721 \nL 323.881317 133.592721 \nL 349.624694 133.592721 \nL 375.368071 133.592721 \nL 401.111447 133.592721 \nL 426.854824 133.592721 \n\" clip-path=\"url(#pa95d5a5130)\" style=\"fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_8\">\n    <path d=\"M 48.427188 142.839219 \nL 48.427188 87.359219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_9\">\n    <path d=\"M 444.875187 142.839219 \nL 444.875187 87.359219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_10\">\n    <path d=\"M 48.427188 142.839219 \nL 444.875188 142.839219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_11\">\n    <path d=\"M 48.427188 87.359219 \nL 444.875188 87.359219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n  </g>\n  <g id=\"axes_3\">\n   <g id=\"patch_12\">\n    <path d=\"M 48.427188 219.199219 \nL 444.875187 219.199219 \nL 444.875187 163.719219 \nL 48.427188 163.719219 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g id=\"matplotlib.axis_5\"/>\n   <g id=\"matplotlib.axis_6\">\n    <g id=\"ytick_7\">\n     <g id=\"line2d_9\">\n      <g>\n       <use xlink:href=\"#m53ee27169b\" x=\"48.427188\" y=\"219.199219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_9\">\n      <!-- −3 -->\n      <g transform=\"translate(26.685 222.998437) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-33\" d=\"M 2597 2516 \nQ 3050 2419 3304 2112 \nQ 3559 1806 3559 1356 \nQ 3559 666 3084 287 \nQ 2609 -91 1734 -91 \nQ 1441 -91 1130 -33 \nQ 819 25 488 141 \nL 488 750 \nQ 750 597 1062 519 \nQ 1375 441 1716 441 \nQ 2309 441 2620 675 \nQ 2931 909 2931 1356 \nQ 2931 1769 2642 2001 \nQ 2353 2234 1838 2234 \nL 1294 2234 \nL 1294 2753 \nL 1863 2753 \nQ 2328 2753 2575 2939 \nQ 2822 3125 2822 3475 \nQ 2822 3834 2567 4026 \nQ 2313 4219 1838 4219 \nQ 1578 4219 1281 4162 \nQ 984 4106 628 3988 \nL 628 4550 \nQ 988 4650 1302 4700 \nQ 1616 4750 1894 4750 \nQ 2613 4750 3031 4423 \nQ 3450 4097 3450 3541 \nQ 3450 3153 3228 2886 \nQ 3006 2619 2597 2516 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-2212\"/>\n       <use xlink:href=\"#DejaVuSans-33\" x=\"83.789062\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_8\">\n     <g id=\"line2d_10\">\n      <g>\n       <use xlink:href=\"#m53ee27169b\" x=\"48.427188\" y=\"191.459219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_10\">\n      <!-- 0 -->\n      <g transform=\"translate(35.064688 195.258437) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-30\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_9\">\n     <g id=\"line2d_11\">\n      <g>\n       <use xlink:href=\"#m53ee27169b\" x=\"48.427188\" y=\"163.719219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_11\">\n      <!-- 3 -->\n      <g transform=\"translate(35.064688 167.518437) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-33\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_12\">\n     <!-- $(x_t)_1$ -->\n     <g transform=\"translate(19.3575 208.739219) rotate(-90) scale(0.16 -0.16)\">\n      <defs>\n       <path id=\"DejaVuSans-Oblique-78\" d=\"M 3841 3500 \nL 2234 1784 \nL 3219 0 \nL 2559 0 \nL 1819 1388 \nL 531 0 \nL -166 0 \nL 1556 1844 \nL 641 3500 \nL 1300 3500 \nL 1972 2234 \nL 3144 3500 \nL 3841 3500 \nz\n\" transform=\"scale(0.015625)\"/>\n      </defs>\n      <use xlink:href=\"#DejaVuSans-28\" transform=\"translate(0 0.125)\"/>\n      <use xlink:href=\"#DejaVuSans-Oblique-78\" transform=\"translate(39.013672 0.125)\"/>\n      <use xlink:href=\"#DejaVuSans-Oblique-74\" transform=\"translate(98.193359 -16.28125) scale(0.7)\"/>\n      <use xlink:href=\"#DejaVuSans-29\" transform=\"translate(128.374023 0.125)\"/>\n      <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(168.344727 -16.28125) scale(0.7)\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"line2d_12\">\n    <path d=\"M 66.447551 190.534552 \nL 90.474703 190.688663 \nL 114.501854 190.842774 \nL 138.529006 190.996886 \nL 162.556157 191.150997 \nL 186.583309 191.305108 \nL 210.61046 191.459219 \nL 234.637612 191.150997 \nL 258.664763 190.842774 \nL 282.691915 190.534552 \nL 306.719066 190.688663 \nL 330.746218 190.842774 \nL 354.773369 190.996885 \nL 378.800521 191.150996 \nL 402.827672 191.305108 \nL 426.854824 191.459219 \n\" clip-path=\"url(#pb7217f3b5f)\" style=\"fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_13\">\n    <path d=\"M 48.427188 219.199219 \nL 48.427188 163.719219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_14\">\n    <path d=\"M 444.875187 219.199219 \nL 444.875187 163.719219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_15\">\n    <path d=\"M 48.427188 219.199219 \nL 444.875188 219.199219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_16\">\n    <path d=\"M 48.427188 163.719219 \nL 444.875188 163.719219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n  </g>\n  <g id=\"axes_4\">\n   <g id=\"patch_17\">\n    <path d=\"M 48.427188 295.559219 \nL 444.875187 295.559219 \nL 444.875187 240.079219 \nL 48.427188 240.079219 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g id=\"matplotlib.axis_7\">\n    <g id=\"xtick_1\">\n     <g id=\"line2d_13\">\n      <defs>\n       <path id=\"m5efc1dc01d\" d=\"M 0 0 \nL 0 3.5 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </defs>\n      <g>\n       <use xlink:href=\"#m5efc1dc01d\" x=\"66.447551\" y=\"295.559219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_13\">\n      <!-- 0 -->\n      <g transform=\"translate(63.266301 310.157656) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-30\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_2\">\n     <g id=\"line2d_14\">\n      <g>\n       <use xlink:href=\"#m5efc1dc01d\" x=\"114.501854\" y=\"295.559219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_14\">\n      <!-- 2 -->\n      <g transform=\"translate(111.320604 310.157656) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-32\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_3\">\n     <g id=\"line2d_15\">\n      <g>\n       <use xlink:href=\"#m5efc1dc01d\" x=\"162.556157\" y=\"295.559219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_15\">\n      <!-- 4 -->\n      <g transform=\"translate(159.374907 310.157656) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-34\" d=\"M 2419 4116 \nL 825 1625 \nL 2419 1625 \nL 2419 4116 \nz\nM 2253 4666 \nL 3047 4666 \nL 3047 1625 \nL 3713 1625 \nL 3713 1100 \nL 3047 1100 \nL 3047 0 \nL 2419 0 \nL 2419 1100 \nL 313 1100 \nL 313 1709 \nL 2253 4666 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-34\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_4\">\n     <g id=\"line2d_16\">\n      <g>\n       <use xlink:href=\"#m5efc1dc01d\" x=\"210.61046\" y=\"295.559219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_16\">\n      <!-- 6 -->\n      <g transform=\"translate(207.42921 310.157656) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-36\" d=\"M 2113 2584 \nQ 1688 2584 1439 2293 \nQ 1191 2003 1191 1497 \nQ 1191 994 1439 701 \nQ 1688 409 2113 409 \nQ 2538 409 2786 701 \nQ 3034 994 3034 1497 \nQ 3034 2003 2786 2293 \nQ 2538 2584 2113 2584 \nz\nM 3366 4563 \nL 3366 3988 \nQ 3128 4100 2886 4159 \nQ 2644 4219 2406 4219 \nQ 1781 4219 1451 3797 \nQ 1122 3375 1075 2522 \nQ 1259 2794 1537 2939 \nQ 1816 3084 2150 3084 \nQ 2853 3084 3261 2657 \nQ 3669 2231 3669 1497 \nQ 3669 778 3244 343 \nQ 2819 -91 2113 -91 \nQ 1303 -91 875 529 \nQ 447 1150 447 2328 \nQ 447 3434 972 4092 \nQ 1497 4750 2381 4750 \nQ 2619 4750 2861 4703 \nQ 3103 4656 3366 4563 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-36\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_5\">\n     <g id=\"line2d_17\">\n      <g>\n       <use xlink:href=\"#m5efc1dc01d\" x=\"258.664763\" y=\"295.559219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_17\">\n      <!-- 8 -->\n      <g transform=\"translate(255.483513 310.157656) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-38\" d=\"M 2034 2216 \nQ 1584 2216 1326 1975 \nQ 1069 1734 1069 1313 \nQ 1069 891 1326 650 \nQ 1584 409 2034 409 \nQ 2484 409 2743 651 \nQ 3003 894 3003 1313 \nQ 3003 1734 2745 1975 \nQ 2488 2216 2034 2216 \nz\nM 1403 2484 \nQ 997 2584 770 2862 \nQ 544 3141 544 3541 \nQ 544 4100 942 4425 \nQ 1341 4750 2034 4750 \nQ 2731 4750 3128 4425 \nQ 3525 4100 3525 3541 \nQ 3525 3141 3298 2862 \nQ 3072 2584 2669 2484 \nQ 3125 2378 3379 2068 \nQ 3634 1759 3634 1313 \nQ 3634 634 3220 271 \nQ 2806 -91 2034 -91 \nQ 1263 -91 848 271 \nQ 434 634 434 1313 \nQ 434 1759 690 2068 \nQ 947 2378 1403 2484 \nz\nM 1172 3481 \nQ 1172 3119 1398 2916 \nQ 1625 2713 2034 2713 \nQ 2441 2713 2670 2916 \nQ 2900 3119 2900 3481 \nQ 2900 3844 2670 4047 \nQ 2441 4250 2034 4250 \nQ 1625 4250 1398 4047 \nQ 1172 3844 1172 3481 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-38\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_6\">\n     <g id=\"line2d_18\">\n      <g>\n       <use xlink:href=\"#m5efc1dc01d\" x=\"306.719066\" y=\"295.559219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_18\">\n      <!-- 10 -->\n      <g transform=\"translate(300.356566 310.157656) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\"/>\n       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_7\">\n     <g id=\"line2d_19\">\n      <g>\n       <use xlink:href=\"#m5efc1dc01d\" x=\"354.773369\" y=\"295.559219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_19\">\n      <!-- 12 -->\n      <g transform=\"translate(348.410869 310.157656) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\"/>\n       <use xlink:href=\"#DejaVuSans-32\" x=\"63.623047\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_8\">\n     <g id=\"line2d_20\">\n      <g>\n       <use xlink:href=\"#m5efc1dc01d\" x=\"402.827672\" y=\"295.559219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_20\">\n      <!-- 14 -->\n      <g transform=\"translate(396.465172 310.157656) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\"/>\n       <use xlink:href=\"#DejaVuSans-34\" x=\"63.623047\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_21\">\n     <!-- $t$ -->\n     <g transform=\"translate(243.451188 328.394844) scale(0.16 -0.16)\">\n      <use xlink:href=\"#DejaVuSans-Oblique-74\" transform=\"translate(0 0.78125)\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"matplotlib.axis_8\">\n    <g id=\"ytick_10\">\n     <g id=\"line2d_21\">\n      <g>\n       <use xlink:href=\"#m53ee27169b\" x=\"48.427188\" y=\"295.559219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_22\">\n      <!-- −5 -->\n      <g transform=\"translate(26.685 299.358437) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-35\" d=\"M 691 4666 \nL 3169 4666 \nL 3169 4134 \nL 1269 4134 \nL 1269 2991 \nQ 1406 3038 1543 3061 \nQ 1681 3084 1819 3084 \nQ 2600 3084 3056 2656 \nQ 3513 2228 3513 1497 \nQ 3513 744 3044 326 \nQ 2575 -91 1722 -91 \nQ 1428 -91 1123 -41 \nQ 819 9 494 109 \nL 494 744 \nQ 775 591 1075 516 \nQ 1375 441 1709 441 \nQ 2250 441 2565 725 \nQ 2881 1009 2881 1497 \nQ 2881 1984 2565 2268 \nQ 2250 2553 1709 2553 \nQ 1456 2553 1204 2497 \nQ 953 2441 691 2322 \nL 691 4666 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-2212\"/>\n       <use xlink:href=\"#DejaVuSans-35\" x=\"83.789062\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_11\">\n     <g id=\"line2d_22\">\n      <g>\n       <use xlink:href=\"#m53ee27169b\" x=\"48.427188\" y=\"267.819219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_23\">\n      <!-- 0 -->\n      <g transform=\"translate(35.064688 271.618437) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-30\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_12\">\n     <g id=\"line2d_23\">\n      <g>\n       <use xlink:href=\"#m53ee27169b\" x=\"48.427188\" y=\"240.079219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_24\">\n      <!-- 5 -->\n      <g transform=\"translate(35.064688 243.878437) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-35\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_25\">\n     <!-- $(x_t)_2$ -->\n     <g transform=\"translate(19.3575 285.099219) rotate(-90) scale(0.16 -0.16)\">\n      <use xlink:href=\"#DejaVuSans-28\" transform=\"translate(0 0.125)\"/>\n      <use xlink:href=\"#DejaVuSans-Oblique-78\" transform=\"translate(39.013672 0.125)\"/>\n      <use xlink:href=\"#DejaVuSans-Oblique-74\" transform=\"translate(98.193359 -16.28125) scale(0.7)\"/>\n      <use xlink:href=\"#DejaVuSans-29\" transform=\"translate(128.374023 0.125)\"/>\n      <use xlink:href=\"#DejaVuSans-32\" transform=\"translate(168.344727 -16.28125) scale(0.7)\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"line2d_24\">\n    <path d=\"M 66.447551 240.079219 \nL 90.474703 243.777919 \nL 114.501854 247.47662 \nL 138.529006 251.17532 \nL 162.556157 254.874021 \nL 186.583309 258.572721 \nL 210.61046 262.271422 \nL 234.637612 265.969953 \nL 258.664763 269.668484 \nL 282.691915 273.367016 \nL 306.719066 277.065716 \nL 330.746218 280.764417 \nL 354.773369 284.463117 \nL 378.800521 288.161818 \nL 402.827672 291.860518 \nL 426.854824 295.559219 \n\" clip-path=\"url(#pf4768d5fa5)\" style=\"fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_18\">\n    <path d=\"M 48.427188 295.559219 \nL 48.427188 240.079219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_19\">\n    <path d=\"M 444.875187 295.559219 \nL 444.875187 240.079219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_20\">\n    <path d=\"M 48.427188 295.559219 \nL 444.875188 295.559219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_21\">\n    <path d=\"M 48.427188 240.079219 \nL 444.875188 240.079219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n  </g>\n </g>\n <defs>\n  <clipPath id=\"p35bcdc312d\">\n   <rect x=\"48.427188\" y=\"10.999219\" width=\"396.448\" height=\"55.48\"/>\n  </clipPath>\n  <clipPath id=\"pa95d5a5130\">\n   <rect x=\"48.427188\" y=\"87.359219\" width=\"396.448\" height=\"55.48\"/>\n  </clipPath>\n  <clipPath id=\"pb7217f3b5f\">\n   <rect x=\"48.427188\" y=\"163.719219\" width=\"396.448\" height=\"55.48\"/>\n  </clipPath>\n  <clipPath id=\"pf4768d5fa5\">\n   <rect x=\"48.427188\" y=\"240.079219\" width=\"396.448\" height=\"55.48\"/>\n  </clipPath>\n </defs>\n</svg>\n"
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": "<Figure size 640x480 with 1 Axes>",
      "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"415.928437pt\" height=\"320.474344pt\" viewBox=\"0 0 415.928437 320.474344\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n <metadata>\n  <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n   <cc:Work>\n    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n    <dc:date>2023-05-22T19:14:36.570466</dc:date>\n    <dc:format>image/svg+xml</dc:format>\n    <dc:creator>\n     <cc:Agent>\n      <dc:title>Matplotlib v3.7.1, https://matplotlib.org/</dc:title>\n     </cc:Agent>\n    </dc:creator>\n   </cc:Work>\n  </rdf:RDF>\n </metadata>\n <defs>\n  <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n </defs>\n <g id=\"figure_1\">\n  <g id=\"patch_1\">\n   <path d=\"M 0 320.474344 \nL 415.928437 320.474344 \nL 415.928437 0 \nL 0 0 \nz\n\" style=\"fill: #ffffff\"/>\n  </g>\n  <g id=\"axes_1\">\n   <g id=\"patch_2\">\n    <path d=\"M 48.427188 277.111219 \nL 405.547188 277.111219 \nL 405.547188 10.999219 \nL 48.427188 10.999219 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g id=\"patch_3\">\n    <path d=\"M 262.699187 144.055219 \nC 272.170121 144.055219 281.254424 141.251295 287.951385 136.260979 \nC 294.648346 131.270663 298.411187 124.501391 298.411187 117.444019 \nC 298.411187 110.386646 294.648346 103.617375 287.951385 98.627059 \nC 281.254424 93.636743 272.170121 90.832819 262.699187 90.832819 \nC 253.228254 90.832819 244.143951 93.636743 237.44699 98.627059 \nC 230.750029 103.617375 226.987188 110.386646 226.987188 117.444019 \nC 226.987188 124.501391 230.750029 131.270663 237.44699 136.260979 \nC 244.143951 141.251295 253.228254 144.055219 262.699187 144.055219 \nz\n\" clip-path=\"url(#p357a068b8d)\" style=\"fill: #ff0000; stroke: #ff0000; stroke-linejoin: miter\"/>\n   </g>\n   <g id=\"patch_4\">\n    <path d=\"M 194.846387 197.277619 \nC 204.317321 197.277619 213.401624 194.473695 220.098585 189.483379 \nC 226.795546 184.493063 230.558387 177.723791 230.558387 170.666419 \nC 230.558387 163.609046 226.795546 156.839775 220.098585 151.849459 \nC 213.401624 146.859143 204.317321 144.055219 194.846387 144.055219 \nC 185.375454 144.055219 176.291151 146.859143 169.59419 151.849459 \nC 162.897229 156.839775 159.134388 163.609046 159.134388 170.666419 \nC 159.134388 177.723791 162.897229 184.493063 169.59419 189.483379 \nC 176.291151 194.473695 185.375454 197.277619 194.846387 197.277619 \nz\n\" clip-path=\"url(#p357a068b8d)\" style=\"fill: #ff0000; stroke: #ff0000; stroke-linejoin: miter\"/>\n   </g>\n   <g id=\"matplotlib.axis_1\">\n    <g id=\"xtick_1\">\n     <g id=\"line2d_1\">\n      <defs>\n       <path id=\"m6678ec39b1\" d=\"M 0 0 \nL 0 3.5 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </defs>\n      <g>\n       <use xlink:href=\"#m6678ec39b1\" x=\"48.427188\" y=\"277.111219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_1\">\n      <!-- −5 -->\n      <g transform=\"translate(41.056094 291.709656) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-2212\" d=\"M 678 2272 \nL 4684 2272 \nL 4684 1741 \nL 678 1741 \nL 678 2272 \nz\n\" transform=\"scale(0.015625)\"/>\n        <path id=\"DejaVuSans-35\" d=\"M 691 4666 \nL 3169 4666 \nL 3169 4134 \nL 1269 4134 \nL 1269 2991 \nQ 1406 3038 1543 3061 \nQ 1681 3084 1819 3084 \nQ 2600 3084 3056 2656 \nQ 3513 2228 3513 1497 \nQ 3513 744 3044 326 \nQ 2575 -91 1722 -91 \nQ 1428 -91 1123 -41 \nQ 819 9 494 109 \nL 494 744 \nQ 775 591 1075 516 \nQ 1375 441 1709 441 \nQ 2250 441 2565 725 \nQ 2881 1009 2881 1497 \nQ 2881 1984 2565 2268 \nQ 2250 2553 1709 2553 \nQ 1456 2553 1204 2497 \nQ 953 2441 691 2322 \nL 691 4666 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-2212\"/>\n       <use xlink:href=\"#DejaVuSans-35\" x=\"83.789062\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_2\">\n     <g id=\"line2d_2\">\n      <g>\n       <use xlink:href=\"#m6678ec39b1\" x=\"84.139187\" y=\"277.111219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_2\">\n      <!-- −4 -->\n      <g transform=\"translate(76.768094 291.709656) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-34\" d=\"M 2419 4116 \nL 825 1625 \nL 2419 1625 \nL 2419 4116 \nz\nM 2253 4666 \nL 3047 4666 \nL 3047 1625 \nL 3713 1625 \nL 3713 1100 \nL 3047 1100 \nL 3047 0 \nL 2419 0 \nL 2419 1100 \nL 313 1100 \nL 313 1709 \nL 2253 4666 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-2212\"/>\n       <use xlink:href=\"#DejaVuSans-34\" x=\"83.789062\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_3\">\n     <g id=\"line2d_3\">\n      <g>\n       <use xlink:href=\"#m6678ec39b1\" x=\"119.851187\" y=\"277.111219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_3\">\n      <!-- −3 -->\n      <g transform=\"translate(112.480094 291.709656) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-33\" d=\"M 2597 2516 \nQ 3050 2419 3304 2112 \nQ 3559 1806 3559 1356 \nQ 3559 666 3084 287 \nQ 2609 -91 1734 -91 \nQ 1441 -91 1130 -33 \nQ 819 25 488 141 \nL 488 750 \nQ 750 597 1062 519 \nQ 1375 441 1716 441 \nQ 2309 441 2620 675 \nQ 2931 909 2931 1356 \nQ 2931 1769 2642 2001 \nQ 2353 2234 1838 2234 \nL 1294 2234 \nL 1294 2753 \nL 1863 2753 \nQ 2328 2753 2575 2939 \nQ 2822 3125 2822 3475 \nQ 2822 3834 2567 4026 \nQ 2313 4219 1838 4219 \nQ 1578 4219 1281 4162 \nQ 984 4106 628 3988 \nL 628 4550 \nQ 988 4650 1302 4700 \nQ 1616 4750 1894 4750 \nQ 2613 4750 3031 4423 \nQ 3450 4097 3450 3541 \nQ 3450 3153 3228 2886 \nQ 3006 2619 2597 2516 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-2212\"/>\n       <use xlink:href=\"#DejaVuSans-33\" x=\"83.789062\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_4\">\n     <g id=\"line2d_4\">\n      <g>\n       <use xlink:href=\"#m6678ec39b1\" x=\"155.563187\" y=\"277.111219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_4\">\n      <!-- −2 -->\n      <g transform=\"translate(148.192094 291.709656) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-32\" d=\"M 1228 531 \nL 3431 531 \nL 3431 0 \nL 469 0 \nL 469 531 \nQ 828 903 1448 1529 \nQ 2069 2156 2228 2338 \nQ 2531 2678 2651 2914 \nQ 2772 3150 2772 3378 \nQ 2772 3750 2511 3984 \nQ 2250 4219 1831 4219 \nQ 1534 4219 1204 4116 \nQ 875 4013 500 3803 \nL 500 4441 \nQ 881 4594 1212 4672 \nQ 1544 4750 1819 4750 \nQ 2544 4750 2975 4387 \nQ 3406 4025 3406 3419 \nQ 3406 3131 3298 2873 \nQ 3191 2616 2906 2266 \nQ 2828 2175 2409 1742 \nQ 1991 1309 1228 531 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-2212\"/>\n       <use xlink:href=\"#DejaVuSans-32\" x=\"83.789062\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_5\">\n     <g id=\"line2d_5\">\n      <g>\n       <use xlink:href=\"#m6678ec39b1\" x=\"191.275188\" y=\"277.111219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_5\">\n      <!-- −1 -->\n      <g transform=\"translate(183.904094 291.709656) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-31\" d=\"M 794 531 \nL 1825 531 \nL 1825 4091 \nL 703 3866 \nL 703 4441 \nL 1819 4666 \nL 2450 4666 \nL 2450 531 \nL 3481 531 \nL 3481 0 \nL 794 0 \nL 794 531 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-2212\"/>\n       <use xlink:href=\"#DejaVuSans-31\" x=\"83.789062\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_6\">\n     <g id=\"line2d_6\">\n      <g>\n       <use xlink:href=\"#m6678ec39b1\" x=\"226.987188\" y=\"277.111219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_6\">\n      <!-- 0 -->\n      <g transform=\"translate(223.805937 291.709656) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-30\" d=\"M 2034 4250 \nQ 1547 4250 1301 3770 \nQ 1056 3291 1056 2328 \nQ 1056 1369 1301 889 \nQ 1547 409 2034 409 \nQ 2525 409 2770 889 \nQ 3016 1369 3016 2328 \nQ 3016 3291 2770 3770 \nQ 2525 4250 2034 4250 \nz\nM 2034 4750 \nQ 2819 4750 3233 4129 \nQ 3647 3509 3647 2328 \nQ 3647 1150 3233 529 \nQ 2819 -91 2034 -91 \nQ 1250 -91 836 529 \nQ 422 1150 422 2328 \nQ 422 3509 836 4129 \nQ 1250 4750 2034 4750 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-30\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_7\">\n     <g id=\"line2d_7\">\n      <g>\n       <use xlink:href=\"#m6678ec39b1\" x=\"262.699187\" y=\"277.111219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_7\">\n      <!-- 1 -->\n      <g transform=\"translate(259.517938 291.709656) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_8\">\n     <g id=\"line2d_8\">\n      <g>\n       <use xlink:href=\"#m6678ec39b1\" x=\"298.411187\" y=\"277.111219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_8\">\n      <!-- 2 -->\n      <g transform=\"translate(295.229938 291.709656) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-32\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_9\">\n     <g id=\"line2d_9\">\n      <g>\n       <use xlink:href=\"#m6678ec39b1\" x=\"334.123188\" y=\"277.111219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_9\">\n      <!-- 3 -->\n      <g transform=\"translate(330.941938 291.709656) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-33\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_10\">\n     <g id=\"line2d_10\">\n      <g>\n       <use xlink:href=\"#m6678ec39b1\" x=\"369.835188\" y=\"277.111219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_10\">\n      <!-- 4 -->\n      <g transform=\"translate(366.653938 291.709656) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-34\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_11\">\n     <g id=\"line2d_11\">\n      <g>\n       <use xlink:href=\"#m6678ec39b1\" x=\"405.547188\" y=\"277.111219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_11\">\n      <!-- 5 -->\n      <g transform=\"translate(402.365938 291.709656) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-35\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_12\">\n     <!-- $x_1$ -->\n     <g transform=\"translate(218.427188 309.946844) scale(0.16 -0.16)\">\n      <defs>\n       <path id=\"DejaVuSans-Oblique-78\" d=\"M 3841 3500 \nL 2234 1784 \nL 3219 0 \nL 2559 0 \nL 1819 1388 \nL 531 0 \nL -166 0 \nL 1556 1844 \nL 641 3500 \nL 1300 3500 \nL 1972 2234 \nL 3144 3500 \nL 3841 3500 \nz\n\" transform=\"scale(0.015625)\"/>\n      </defs>\n      <use xlink:href=\"#DejaVuSans-Oblique-78\" transform=\"translate(0 0.3125)\"/>\n      <use xlink:href=\"#DejaVuSans-31\" transform=\"translate(59.179688 -16.09375) scale(0.7)\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"matplotlib.axis_2\">\n    <g id=\"ytick_1\">\n     <g id=\"line2d_12\">\n      <defs>\n       <path id=\"m6aae25bb3f\" d=\"M 0 0 \nL -3.5 0 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </defs>\n      <g>\n       <use xlink:href=\"#m6aae25bb3f\" x=\"48.427188\" y=\"277.111219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_13\">\n      <!-- −5 -->\n      <g transform=\"translate(26.685 280.910437) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-2212\"/>\n       <use xlink:href=\"#DejaVuSans-35\" x=\"83.789062\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_2\">\n     <g id=\"line2d_13\">\n      <g>\n       <use xlink:href=\"#m6aae25bb3f\" x=\"48.427188\" y=\"250.500019\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_14\">\n      <!-- −4 -->\n      <g transform=\"translate(26.685 254.299237) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-2212\"/>\n       <use xlink:href=\"#DejaVuSans-34\" x=\"83.789062\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_3\">\n     <g id=\"line2d_14\">\n      <g>\n       <use xlink:href=\"#m6aae25bb3f\" x=\"48.427188\" y=\"223.888819\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_15\">\n      <!-- −3 -->\n      <g transform=\"translate(26.685 227.688037) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-2212\"/>\n       <use xlink:href=\"#DejaVuSans-33\" x=\"83.789062\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_4\">\n     <g id=\"line2d_15\">\n      <g>\n       <use xlink:href=\"#m6aae25bb3f\" x=\"48.427188\" y=\"197.277619\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_16\">\n      <!-- −2 -->\n      <g transform=\"translate(26.685 201.076837) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-2212\"/>\n       <use xlink:href=\"#DejaVuSans-32\" x=\"83.789062\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_5\">\n     <g id=\"line2d_16\">\n      <g>\n       <use xlink:href=\"#m6aae25bb3f\" x=\"48.427188\" y=\"170.666419\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_17\">\n      <!-- −1 -->\n      <g transform=\"translate(26.685 174.465637) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-2212\"/>\n       <use xlink:href=\"#DejaVuSans-31\" x=\"83.789062\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_6\">\n     <g id=\"line2d_17\">\n      <g>\n       <use xlink:href=\"#m6aae25bb3f\" x=\"48.427188\" y=\"144.055219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_18\">\n      <!-- 0 -->\n      <g transform=\"translate(35.064688 147.854437) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-30\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_7\">\n     <g id=\"line2d_18\">\n      <g>\n       <use xlink:href=\"#m6aae25bb3f\" x=\"48.427188\" y=\"117.444019\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_19\">\n      <!-- 1 -->\n      <g transform=\"translate(35.064688 121.243237) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-31\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_8\">\n     <g id=\"line2d_19\">\n      <g>\n       <use xlink:href=\"#m6aae25bb3f\" x=\"48.427188\" y=\"90.832819\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_20\">\n      <!-- 2 -->\n      <g transform=\"translate(35.064688 94.632037) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-32\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_9\">\n     <g id=\"line2d_20\">\n      <g>\n       <use xlink:href=\"#m6aae25bb3f\" x=\"48.427188\" y=\"64.221619\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_21\">\n      <!-- 3 -->\n      <g transform=\"translate(35.064688 68.020837) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-33\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_10\">\n     <g id=\"line2d_21\">\n      <g>\n       <use xlink:href=\"#m6aae25bb3f\" x=\"48.427188\" y=\"37.610419\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_22\">\n      <!-- 4 -->\n      <g transform=\"translate(35.064688 41.409637) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-34\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_11\">\n     <g id=\"line2d_22\">\n      <g>\n       <use xlink:href=\"#m6aae25bb3f\" x=\"48.427188\" y=\"10.999219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_23\">\n      <!-- 5 -->\n      <g transform=\"translate(35.064688 14.798437) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-35\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_24\">\n     <!-- $x_2$ -->\n     <g transform=\"translate(19.3575 152.615219) rotate(-90) scale(0.16 -0.16)\">\n      <use xlink:href=\"#DejaVuSans-Oblique-78\" transform=\"translate(0 0.3125)\"/>\n      <use xlink:href=\"#DejaVuSans-32\" transform=\"translate(59.179688 -16.09375) scale(0.7)\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"line2d_23\">\n    <defs>\n     <path id=\"m66d32dc673\" d=\"M 0 3 \nC 0.795609 3 1.55874 2.683901 2.12132 2.12132 \nC 2.683901 1.55874 3 0.795609 3 0 \nC 3 -0.795609 2.683901 -1.55874 2.12132 -2.12132 \nC 1.55874 -2.683901 0.795609 -3 0 -3 \nC -0.795609 -3 -1.55874 -2.683901 -2.12132 -2.12132 \nC -2.683901 -1.55874 -3 -0.795609 -3 0 \nC -3 0.795609 -2.683901 1.55874 -2.12132 2.12132 \nC -1.55874 2.683901 -0.795609 3 0 3 \nz\n\" style=\"stroke: #1f77b4\"/>\n    </defs>\n    <g clip-path=\"url(#p357a068b8d)\">\n     <use xlink:href=\"#m66d32dc673\" x=\"230.558387\" y=\"10.999219\" style=\"fill: #1f77b4; stroke: #1f77b4\"/>\n     <use xlink:href=\"#m66d32dc673\" x=\"229.963187\" y=\"28.740181\" style=\"fill: #1f77b4; stroke: #1f77b4\"/>\n     <use xlink:href=\"#m66d32dc673\" x=\"229.367987\" y=\"46.481143\" style=\"fill: #1f77b4; stroke: #1f77b4\"/>\n     <use xlink:href=\"#m66d32dc673\" x=\"228.772787\" y=\"64.222105\" style=\"fill: #1f77b4; stroke: #1f77b4\"/>\n     <use xlink:href=\"#m66d32dc673\" x=\"228.177587\" y=\"81.963067\" style=\"fill: #1f77b4; stroke: #1f77b4\"/>\n     <use xlink:href=\"#m66d32dc673\" x=\"227.582387\" y=\"99.70403\" style=\"fill: #1f77b4; stroke: #1f77b4\"/>\n     <use xlink:href=\"#m66d32dc673\" x=\"226.987187\" y=\"117.444992\" style=\"fill: #1f77b4; stroke: #1f77b4\"/>\n     <use xlink:href=\"#m66d32dc673\" x=\"228.177587\" y=\"135.185143\" style=\"fill: #1f77b4; stroke: #1f77b4\"/>\n     <use xlink:href=\"#m66d32dc673\" x=\"229.367988\" y=\"152.925294\" style=\"fill: #1f77b4; stroke: #1f77b4\"/>\n     <use xlink:href=\"#m66d32dc673\" x=\"230.558388\" y=\"170.665446\" style=\"fill: #1f77b4; stroke: #1f77b4\"/>\n     <use xlink:href=\"#m66d32dc673\" x=\"229.963188\" y=\"188.406408\" style=\"fill: #1f77b4; stroke: #1f77b4\"/>\n     <use xlink:href=\"#m66d32dc673\" x=\"229.367988\" y=\"206.14737\" style=\"fill: #1f77b4; stroke: #1f77b4\"/>\n     <use xlink:href=\"#m66d32dc673\" x=\"228.772788\" y=\"223.888332\" style=\"fill: #1f77b4; stroke: #1f77b4\"/>\n     <use xlink:href=\"#m66d32dc673\" x=\"228.177588\" y=\"241.629295\" style=\"fill: #1f77b4; stroke: #1f77b4\"/>\n     <use xlink:href=\"#m66d32dc673\" x=\"227.582388\" y=\"259.370257\" style=\"fill: #1f77b4; stroke: #1f77b4\"/>\n     <use xlink:href=\"#m66d32dc673\" x=\"226.987188\" y=\"277.111219\" style=\"fill: #1f77b4; stroke: #1f77b4\"/>\n    </g>\n   </g>\n   <g id=\"line2d_24\">\n    <path d=\"M 230.558387 10.999219 \nL 229.963187 28.740181 \nL 229.367987 46.481143 \nL 228.772787 64.222105 \nL 228.177587 81.963067 \nL 227.582387 99.70403 \nL 226.987187 117.444992 \nL 228.177587 135.185143 \nL 229.367988 152.925294 \nL 230.558388 170.665446 \nL 229.963188 188.406408 \nL 229.367988 206.14737 \nL 228.772788 223.888332 \nL 228.177588 241.629295 \nL 227.582388 259.370257 \nL 226.987188 277.111219 \n\" clip-path=\"url(#p357a068b8d)\" style=\"fill: none; stroke: #000000; stroke-width: 1.5; stroke-linecap: square\"/>\n   </g>\n   <g id=\"line2d_25\">\n    <defs>\n     <path id=\"m8996572895\" d=\"M -3 3 \nL 3 3 \nL 3 -3 \nL -3 -3 \nz\n\" style=\"stroke: #0000ff; stroke-linejoin: miter\"/>\n    </defs>\n    <g clip-path=\"url(#p357a068b8d)\">\n     <use xlink:href=\"#m8996572895\" x=\"230.558388\" y=\"10.999219\" style=\"fill: #0000ff; stroke: #0000ff; stroke-linejoin: miter\"/>\n    </g>\n   </g>\n   <g id=\"line2d_26\">\n    <defs>\n     <path id=\"m1011855887\" d=\"M -3 3 \nL 3 3 \nL 3 -3 \nL -3 -3 \nz\n\" style=\"stroke: #ff0000; stroke-linejoin: miter\"/>\n    </defs>\n    <g clip-path=\"url(#p357a068b8d)\">\n     <use xlink:href=\"#m1011855887\" x=\"226.987188\" y=\"277.111219\" style=\"fill: #ff0000; stroke: #ff0000; stroke-linejoin: miter\"/>\n    </g>\n   </g>\n   <g id=\"patch_5\">\n    <path d=\"M 48.427188 277.111219 \nL 48.427188 10.999219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_6\">\n    <path d=\"M 405.547188 277.111219 \nL 405.547188 10.999219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_7\">\n    <path d=\"M 48.427188 277.111219 \nL 405.547188 277.111219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_8\">\n    <path d=\"M 48.427188 10.999219 \nL 405.547188 10.999219 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n  </g>\n </g>\n <defs>\n  <clipPath id=\"p357a068b8d\">\n   <rect x=\"48.427188\" y=\"10.999219\" width=\"357.12\" height=\"266.112\"/>\n  </clipPath>\n </defs>\n</svg>\n"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Plot results.\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline\n",
    "%config InlineBackend.figure_format = 'svg'\n",
    "\n",
    "f = plt.figure()\n",
    "\n",
    "# Plot (u_t)_1.\n",
    "ax = f.add_subplot(411)\n",
    "plt.plot(u[0,:].value)\n",
    "plt.ylabel(r\"$(u_t)_1$\", fontsize=16)\n",
    "plt.yticks(np.linspace(-1.0, 1.0, 3))\n",
    "plt.xticks([])\n",
    "\n",
    "# Plot (u_t)_2.\n",
    "plt.subplot(4,1,2)\n",
    "plt.plot(u[1,:].value)\n",
    "plt.ylabel(r\"$(u_t)_2$\", fontsize=16)\n",
    "plt.yticks(np.linspace(-1, 1, 3))\n",
    "plt.xticks([])\n",
    "\n",
    "# # Plot (x_t)_1.\n",
    "# plt.subplot(4,1,3)\n",
    "# x1 = x[0,:].value\n",
    "# plt.plot(x1)\n",
    "# plt.ylabel(r\"$(x_t)_1$\", fontsize=16)\n",
    "# plt.yticks([-10, 0, 10])\n",
    "# plt.ylim([-10, 10])\n",
    "# plt.xticks([])\n",
    "#\n",
    "# # Plot (x_t)_2.\n",
    "# plt.subplot(4,1,4)\n",
    "# x2 = x[1,:].value\n",
    "# plt.plot(range(51), x2)\n",
    "# plt.yticks([-25, 0, 25])\n",
    "# plt.ylim([-25, 25])\n",
    "# plt.ylabel(r\"$(x_t)_2$\", fontsize=16)\n",
    "# plt.xlabel(r\"$t$\", fontsize=16)\n",
    "# plt.tight_layout()\n",
    "# plt.show()\n",
    "\n",
    "# Plot (x_t)_1.\n",
    "plt.subplot(4,1,3)\n",
    "x1 = x[0,:].value\n",
    "plt.plot(x1)\n",
    "plt.ylabel(r\"$(x_t)_1$\", fontsize=16)\n",
    "plt.yticks([-3, 0, 3])\n",
    "plt.ylim([-3, 3])\n",
    "plt.xticks([])\n",
    "\n",
    "# Plot (x_t)_2.\n",
    "plt.subplot(4,1,4)\n",
    "x2 = x[1,:].value\n",
    "plt.plot(range(16), x2)\n",
    "plt.yticks([-5, 0, 5])\n",
    "plt.ylim([-5, 5])\n",
    "plt.ylabel(r\"$(x_t)_2$\", fontsize=16)\n",
    "plt.xlabel(r\"$t$\", fontsize=16)\n",
    "plt.tight_layout()\n",
    "plt.show()\n",
    "\n",
    "# 在一个新的绘图窗口中绘制点的轨迹，并明显标识出每个点\n",
    "plt.figure()\n",
    "plt.plot(x1, x2, 'o')\n",
    "plt.plot(x1, x2, 'k-')\n",
    "plt.plot(x_0[0], x_0[1], 'bs')\n",
    "plt.plot(x_t[0], x_t[1], 'rs')\n",
    "plt.xlabel(r\"$x_1$\", fontsize=16)\n",
    "plt.ylabel(r\"$x_2$\", fontsize=16)\n",
    "\n",
    "# 绘制障碍物1\n",
    "# circle1 = plt.Circle((0, 0), 2, color='r')\n",
    "# plt.gcf().gca().add_artist(circle1)\n",
    "# plt.axis([-3, 3, -5, 5])\n",
    "# plt.xticks(np.linspace(-5, 5, 11))\n",
    "# plt.yticks(np.linspace(-5, 5, 11))\n",
    "# plt.show()\n",
    "\n",
    "# 绘制障碍物 2 和 3\n",
    "circle2 = plt.Circle((1, 1), 1, color='r')\n",
    "plt.gcf().gca().add_artist(circle2)\n",
    "circle3 = plt.Circle((-0.9, -1), 1, color='r')\n",
    "plt.gcf().gca().add_artist(circle3)\n",
    "plt.axis([-5, 5, -5, 5])\n",
    "plt.xticks(np.linspace(-5, 5, 11))\n",
    "plt.yticks(np.linspace(-5, 5, 11))\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "colab": {
   "name": "control.ipynb",
   "provenance": []
  },
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
